<template>
  <div id="app">
    <nav>
      <router-link to="/Home" active-class="active-link">Home</router-link>
      |
      <router-link to="/transition" active-class="active-link">Transition</router-link>
      |
      <router-link to="/animate" active-class="active-link">Animate</router-link>
      |
      <router-link to="/thirdParty" active-class="active-link">第三方库</router-link>
    </nav>

    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'App',
  methods: {
    isActive(route) {
      // 判断当前路由是否匹配
      return this.$route.path === route
    },
  },
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

nav {
  padding: 10px;
}

nav a {
  text-decoration: none;
  color: black; /* 默认文本颜色 */

  &.active-link {
    font-weight: bold; /* 激活链接的样式 */
    text-decoration: underline; /* 添加下划线 */
    color: green; /* 改变颜色 */
  }
}
</style>

